<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
	<div id="workspace" class="col-xs-12">
                <br/>
                <ol class="breadcrumb">
                    <li><a href="index.jsp"><span class="glyphicon glyphicon-home"></span>&nbsp;后台首页</a></li>
                    <li class="active">用户管理-查看用户</li>
                </ol>
                
                <table class="table table-bordered table-striped text-center bg-info">
                    <thead >
                    <tr class="info">
                        <th class="text-center">序号</th>
						<th class="text-center">用户名</th>									
						<th class="text-center">密码</th>	
						<th class="text-center">类型</th>	
                        <th class="text-center">备注</th>
						<th class="text-center">邮箱</th>
                        <th class="text-center">操作</th>
                    </tr>
                    </thead>
                    <tbody>
					
					 <%int i =1; %>
              <c:forEach var="user" items="${requestScope.users }">
              	<tr>
                  <td><%=i++ %></td>
                  <td>${user.userName }</td>
                  <td>${user.pwd }</td>
                  <td>${user.category }</td>
                   <c:choose>
                   	<c:when test="${user.belongTo == '1'}">
                   		<td>校级</td>
                   	</c:when>
                   	<c:when test="${user.belongTo == '2'}">
                   		<td>网安学院</td>
                   	</c:when>
                   	<c:when test="${user.belongTo == '3'}">
                   		<td>光电学院</td>
                   	</c:when>
                   	<c:when test="${user.belongTo == '4'}">
                   		<td>控制工程</td>
                   	</c:when>
                   	<c:when test="${user.belongTo == '5'}">
                   		<td>软件学院</td>
                   	</c:when>
                   	<c:when test="${user.belongTo == '6'}">
                   		<td>英语学院</td>
                   	</c:when>
                   	<c:when test="${user.belongTo == '7'}">
                   		<td>校外单位</td>
                   	</c:when>
                   	<c:otherwise>
                   		<td>空</td>
                   	</c:otherwise>
                   </c:choose>
                  <td>13419309974@163.com</td>
                  <td>
                     <a href="javascript:void(0);" onclick="addUser()" class="btn btn-primary btn-sm" ><span class="glyphicon glyphicon-pencil"></span>&nbsp;新增</a>
                     <a href="user.con?id=${user.id}&userName=${user.userName}&pwd=${user.pwd}&work=delete" class="btn btn-primary btn-sm" ><span class="glyphicon glyphicon-trash"></span> &nbsp;删除</a>
				  </td>
                </tr>
              </c:forEach>
              <%request.removeAttribute("users"); %>
                    </tbody>
                </table>
                <ul class="pagination right">
                    <li class="disabled"><a href="#" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a>
                    </li>
                    <li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li>
                    <li><a href="#">2</a></li>
                    <li><a href="#">3</a></li>
                    <li><a href="#">4</a></li>
                    <li><a href="#">5</a></li>
                    <li><a href="#" aria-label="Next"><span aria-hidden="true">&raquo;</span></a></li>
                </ul>
            </div>
</body>
</html>